package o;

import android.text.TextUtils;
import com.huawei.appgallery.appcomment.impl.bean.GetCommentResBean;
import com.huawei.appgallery.appcomment.impl.bean.GetCommentResBean.AppCommentInfo;
import com.huawei.appgallery.appcomment.impl.bean.GetCommentResBean.RatingDst;
import com.huawei.appgallery.appcomment.impl.bean.GetCommentResBean.WordsOfDevInfo;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import o.bds.c;

public class bdm extends bds {
    private boolean ʻ = true;
    private float ʼ;
    private int ʽ = 1;
    private float ˊ;
    private int ˊॱ = 0;
    private int ˋ = 0;
    private boolean ˋॱ = false;
    private List<AppCommentInfo> ˎ = new ArrayList();
    private List<RatingDst> ˏ;
    private int ˏॱ = 0;
    private c ͺ = null;
    private int ॱ = 0;
    private String ॱˊ;
    private bdi ॱॱ;
    private List<WordsOfDevInfo> ᐝ;

    public static class e implements Serializable {
        private int ʻ = 0;
        private int ʼ;
        private String ˊ;
        private String ˋ;
        private int ˎ;
        private int ˏ;
        private int ॱ;
        private int ᐝ = 0;

        public int ˊ() {
            return this.ʼ;
        }

        public void ˋ(int i) {
            this.ʼ = i;
        }

        public int ˎ() {
            return this.ˏ;
        }

        public void ॱ(int i) {
            this.ˏ = i;
        }

        public String ˏ() {
            return this.ˋ;
        }

        public void ˎ(String str) {
            this.ˋ = str;
        }

        public String ॱ() {
            return this.ˊ;
        }

        public void ˋ(String str) {
            this.ˊ = str;
        }

        public int ˋ() {
            return this.ᐝ;
        }

        public void ˎ(int i) {
            this.ᐝ = i;
        }

        public int ʻ() {
            return this.ʻ;
        }

        public void ˊ(int i) {
            this.ʻ = i;
        }

        public int ॱॱ() {
            return this.ॱ;
        }

        public void ˏ(int i) {
            this.ॱ = i;
        }

        public int ᐝ() {
            return this.ˎ;
        }

        public void ᐝ(int i) {
            this.ˎ = i;
        }
    }

    public String ˋ() {
        return this.ॱˊ;
    }

    public void ˎ(String str) {
        this.ॱˊ = str;
    }

    public bdi ˊ() {
        return this.ॱॱ;
    }

    public void ॱ(bdi o_bdi) {
        this.ॱॱ = o_bdi;
    }

    public void ˏ(c cVar) {
        this.ͺ = cVar;
    }

    public void ˎ(bdi o_bdi, GetCommentResBean getCommentResBean) {
        if (o_bdi.ˎ() == 1 && !cgs.ˋ(getCommentResBean.ᐝ())) {
            ॱ(getCommentResBean.ᐝ());
            ॱ(getCommentResBean.ᐝ().size());
        }
        if (o_bdi.ˎ() == 1) {
            boolean z = !"1".equals(o_bdi.ˋ()) && cgs.ˋ(getCommentResBean.ˋ());
            if (z) {
                ˎ(true);
            } else {
                AppCommentInfo appCommentInfo = new AppCommentInfo();
                appCommentInfo.ʼ(2);
                appCommentInfo.ˊ(o_bdi.ˋ());
                appCommentInfo.ʽ(o_bdi.ˊ());
                appCommentInfo.ॱॱ(o_bdi.ˏ());
                ॱˎ().add(appCommentInfo);
            }
        }
        ˊ(getCommentResBean.ˎ());
        if (!cgs.ˋ(getCommentResBean.ˋ())) {
            ॱˎ().addAll(getCommentResBean.ˋ());
            ˊ(getCommentResBean.ˋ().size());
        }
        if (getCommentResBean.ʼ() != null && getCommentResBean.ʼ().size() > 0) {
            ˋ(getCommentResBean.ʼ());
            try {
                ॱ(Float.parseFloat(getCommentResBean.ˏ()));
            } catch (NumberFormatException e) {
                bcb.ˋ.ˊ("AppCommentProvider", "addData NumberFormatException:stars=" + getCommentResBean.ˏ());
            }
            try {
                ˎ(Float.parseFloat(getCommentResBean.ॱ()));
            } catch (NumberFormatException e2) {
                bcb.ˋ.ˊ("AppCommentProvider", "addData NumberFormatException:score=" + getCommentResBean.ॱ());
                ˎ(ͺ());
            }
            ˎ(0);
            for (RatingDst ratingDst : ʽ()) {
                if (ratingDst != null) {
                    ˎ(ratingDst.ˋ() + ʻ());
                }
            }
        }
    }

    public int ॱ() {
        return this.ˊॱ;
    }

    public int ˎ() {
        return this.ˏॱ;
    }

    public void ॱ(int i) {
        this.ˏॱ = i;
    }

    public int ˏ() {
        return ॱˎ().size();
    }

    public AppCommentInfo ˏ(int i) {
        AppCommentInfo appCommentInfo = null;
        if (i < ॱˎ().size() && i >= 0) {
            appCommentInfo = (AppCommentInfo) ॱˎ().get(i);
            if (appCommentInfo != null) {
                appCommentInfo.ᐝ(i);
            }
        }
        return appCommentInfo;
    }

    public AppCommentInfo ˋ(String str) {
        List<AppCommentInfo> ॱˎ = ॱˎ();
        if (ॱˎ != null && ॱˎ.size() > 0) {
            for (AppCommentInfo appCommentInfo : ॱˎ) {
                if (!TextUtils.isEmpty(str) && str.equals(appCommentInfo.ॱ())) {
                    return appCommentInfo;
                }
            }
        }
        return null;
    }

    public void ˋ(e eVar) {
        if (eVar != null) {
            try {
                AppCommentInfo ˋ = ˋ(eVar.ॱ());
                if (ˋ != null) {
                    bdo.ˎ(eVar, ˋ);
                }
            } catch (Exception e) {
                bcb.ˋ.ˏ("AppCommentProvider", "updateCommentInfo error" + e.toString());
            }
        }
        if (this.ͺ != null) {
            this.ͺ.onDataUpdated();
        }
    }

    public void ˊ(String str) {
        List<AppCommentInfo> arrayList = new ArrayList();
        arrayList.addAll(ॱˎ());
        if (arrayList.size() > 0) {
            for (AppCommentInfo appCommentInfo : arrayList) {
                if (!TextUtils.isEmpty(appCommentInfo.ॱ()) && appCommentInfo.ॱ().equals(str)) {
                    this.ˎ.remove(appCommentInfo);
                    break;
                }
            }
            if (this.ͺ != null) {
                this.ͺ.onDataUpdated();
            }
        }
    }

    public void ˏ(e eVar) {
        if (eVar != null) {
            try {
                AppCommentInfo ˏ = ˏ(eVar.ˎ());
                if (ˏ != null && ˏ.ॱ().equals(eVar.ॱ())) {
                    bdo.ˋ(eVar, ˏ);
                    if (this.ͺ != null) {
                        this.ͺ.onDataUpdated();
                    }
                }
            } catch (Exception e) {
                bcb.ˋ.ˏ("AppCommentProvider", "updateCollectInfo error" + e.toString());
            }
        }
    }

    public void ᐝ() {
        ॱˎ().clear();
        this.ʻ = true;
        this.ʽ = 1;
        if (this.ͺ != null) {
            this.ͺ.onDataUpdated();
        }
    }

    public boolean ʼ() {
        return this.ʻ;
    }

    public void ˋ(boolean z) {
        this.ʻ = z;
    }

    private List<AppCommentInfo> ॱˎ() {
        return this.ˎ;
    }

    public List<RatingDst> ʽ() {
        return this.ˏ;
    }

    private void ˋ(List<RatingDst> list) {
        this.ˏ = list;
    }

    public int ʻ() {
        return this.ॱ;
    }

    private void ˎ(int i) {
        this.ॱ = i;
    }

    public int ॱॱ() {
        return this.ˋ;
    }

    private void ˊ(int i) {
        this.ˋ = i;
    }

    public float ͺ() {
        return this.ˊ;
    }

    private void ॱ(float f) {
        this.ˊ = f;
    }

    public List<WordsOfDevInfo> ॱˊ() {
        return this.ᐝ;
    }

    public void ॱ(List<WordsOfDevInfo> list) {
        this.ᐝ = list;
    }

    public float ˊॱ() {
        return this.ʼ;
    }

    private void ˎ(float f) {
        this.ʼ = f;
    }

    public int ˋॱ() {
        return this.ʽ;
    }

    public void ˋ(int i) {
        this.ʽ = i;
    }

    public boolean ˏॱ() {
        return this.ˋॱ;
    }

    public void ˎ(boolean z) {
        this.ˋॱ = z;
    }
}
